package com.linsen.uaa.provider.feign;

import com.linsen.core.common.constant.ProviderConstant;
import com.linsen.core.common.util.Result;
import com.linsen.core.feign.constant.FeignConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @author zhaoyong
 * @date 2023/3/15
 */
@ApiIgnore
@FeignClient(FeignConstant.LINSEN_CLOUD_UAA)
public interface IAuthFeignClient {
    /**
     * 获取当前登录用户信息
     *
     * @return
     */
    @GetMapping(ProviderConstant.PROVIDER_USER)
    Result getUser();

    /**
     * 根据Id获取当前登录用户信息
     *
     * @return
     */
    @GetMapping(ProviderConstant.PROVIDER_USER_ID)
    Result getUserByUserId(@RequestParam("userId") String userId);

    /**
     * 获取当前登录用户信息-根据Token
     *
     * @return
     */
    @GetMapping(ProviderConstant.PROVIDER_USER_TOKEN)
    Result getUserByTokenValue(@RequestParam("tokenValue") String tokenValue);
}
